home *** CD-ROM | disk | FTP | other *** search
/ Network CD 2 / Network CD - Volume 2.iso / programs / dopus / arexx_scripts / dopusutils / rexx / multilzh2.dopus < prev    next >
Encoding:
Text File  |  1991-10-14  |  1.8 KB  |  81 lines

  1. /* 
  2.  * 
  3.  *           *******************************
  4.  *           * DOpus LZH Multi-selector    *
  5.  *           *                             *
  6.  *           *        The Archiver         *
  7.  *           *                             *
  8.  *           * MicroTech Solutions, Inc.   *
  9.  *           *******************************
  10.  */
  11.  
  12. options results
  13.  
  14. count = 1
  15.  
  16. address command
  17. return = Open(infile,"ram:infiles.txt","R")
  18. if return > 0 then do
  19.   do until EOF(infile)
  20.      name.count = ReadLn(infile)
  21.      count = count + 1
  22.      end
  23.   return = close(infile)
  24.   count = count - 2
  25. end
  26.  
  27. if count < 1|left(name.1,1) ~='"' then do
  28.   address 'dopus_rexx'
  29.   request "No input files. You must first select some files to be LZH'd"
  30.   exit
  31.   end
  32.  
  33. address 'dopus_rexx'
  34.  
  35. request "Have you selected the proper destination directory?"
  36. ans = RESULT
  37. if ans = 0 then exit
  38.  
  39. toptext "Multi-LZH AREXX by John Crookshank"
  40. getname:
  41. getstring "Enter the destination filename"
  42. outname = RESULT
  43.  
  44. if outname = ''|outname = 'RESULT'|outname = '1' then do
  45.    request "I need an output filename before I can continue, please!"
  46.    ans = RESULT
  47.    if ans = 1 then signal getname
  48.    exit
  49.    end
  50.  
  51. toptext "Multi-LZH AREXX by John Crookshank.  Processing "count" entries..."
  52.  
  53. status 3       /* get window number */
  54. win = RESULT
  55. status 13 win    /* get path of displayed window */
  56. path = RESULT
  57.  
  58. address command
  59.  
  60. test = right(outname,4)
  61. if test ~= '.lzh'&test ~= '.LZH' then do
  62.    outname = outname||'.LZH'
  63.    end
  64.  
  65. 'c:copy c:lharc ram:'
  66. counter = 1
  67. do until counter > count
  68.     'ram:lharc >nil: <nil: -r a' path||outname name.counter
  69.     counter = counter + 1
  70.     end
  71.  
  72. 'c:delete ram:infiles.txt quiet'
  73. 'c:delete ram:lharc quiet'
  74.  
  75. address 'dopus_rexx'
  76. status 3 set win
  77. status 13 win set path
  78. mssg = count||' entries archived into' path||outname
  79. request mssg
  80. exit
  81.